package edu.njust.cma.controller;

import edu.njust.cma.pojo.Result;
import edu.njust.cma.util.AliOSSUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
public class UploadController {
    @Autowired
    AliOSSUtils aliOSSUtils;

//    @PostMapping("/upload")
//    public Result upload(MultipartFile file) throws IOException {
//        //调用阿里云OSS工具类上传文件
//        String url = aliOSSUtils.upload(file);
//        //返回成功
//        return Result.success(url);
//    }
}
